package com.legendshop.openportal.sdk.service;

import cn.hutool.core.lang.TypeReference;
import com.legendshop.openportal.sdk.model.OpenPageSupport;
import com.legendshop.openportal.sdk.model.OpenResult;
import com.legendshop.openportal.sdk.model.request.v4.UserForceLogoutV4Request;
import com.legendshop.openportal.sdk.model.request.v4.UserInfoV4Request;
import com.legendshop.openportal.sdk.model.request.v4.UserPageV4Request;
import com.legendshop.openportal.sdk.model.response.v4.UserInfoV4Response;
import com.legendshop.openportal.sdk.model.response.v4.UserPageV4Response;

public class UserService extends BaseService {

    /**
     * 查询用户分页列表
     * @param request
     * @return
     */
    public static OpenResult<OpenPageSupport<UserPageV4Response>> queryUserPage(UserPageV4Request request) {
        return execute(request, new TypeReference<OpenPageSupport<UserPageV4Response>>() {});
    }

    /**
     * 查询用户详情
     *
     * @param request
     * @return
     */
    public static OpenResult<UserInfoV4Response> queryUserInfo(UserInfoV4Request request) {
        return execute(request, UserInfoV4Response.class);
    }

    /**
     * 强制用户注销登录V4
     *
     * @param request
     * @return
     */
    public static OpenResult<Void> forceLogoutV4(UserForceLogoutV4Request request) {
        return execute(request, Void.class);
    }
}
